package cn.edu.zafu.bigdata.x.zyy;


public class Course {
    private String name;       // 课程名称
    private String courseID;   // 课程编号
    private int credits;       // 课程学分
    private String instructor;  // 教师名称

    // 构造函数
    public Course(String name, String courseID, int credits, String instructor) {
        this.name = name;
        this.courseID = courseID;
        this.credits = credits;
        this.instructor = instructor;
    }

    // print方法，输出课程信息
    public void print() {
        System.out.println("课程名称: " + name);
        System.out.println("课程编号: " + courseID);
        System.out.println("学分: " + credits);
        System.out.println("教师: " + instructor);
    }

    // Getter和Setter方法
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCourseID() {
        return courseID;
    }

    public void setCourseID(String courseID) {
        this.courseID = courseID;
    }

    public int getCredits() {
        return credits;
    }

    public void setCredits(int credits) {
        this.credits = credits;
    }

    public String getInstructor() {
        return instructor;
    }

    public void setInstructor(String instructor) {
        this.instructor = instructor;
    }

    // 主函数，用于测试Course类
    public static void main(String[] args) {
        Course course = new Course("计算机科学导论", "CS101", 4, "张教授");
        course.print();
    }
}